package com.androidx.p013lv.invention.view;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.InventionBean;
import com.androidx.p013lv.base.bean.VideoBean;
import com.androidx.p013lv.base.listener.ItemClickListener;
import com.androidx.p013lv.base.p015ui.LazyFragment;
import com.androidx.p013lv.invention.C1069R;
import com.androidx.p013lv.invention.OnInventionType;
import com.androidx.p013lv.invention.adapter.AdapterInvention;

/* renamed from: com.androidx.lv.invention.view.OneView */
public class OneView {
    AdapterInvention adapter;
    LinearLayout btn_more;
    LinearLayout btn_swap;
    Context context;
    String domain;
    Fragment fragment;
    InventionBean inventionBean;
    ImageView iv_swap;
    OnInventionType onInventionType;
    int position;
    RecyclerView recycler;
    TextView tv_title;

    public OneView(View view, Fragment fragment2, String str, OnInventionType onInventionType2) {
        this.context = view.getContext();
        this.onInventionType = onInventionType2;
        this.domain = str;
        this.fragment = fragment2;
        this.tv_title = (TextView) view.findViewById(C1069R.C1072id.tv_title);
        this.recycler = (RecyclerView) view.findViewById(C1069R.C1072id.recycler);
        this.btn_swap = (LinearLayout) view.findViewById(C1069R.C1072id.btn_swap);
        this.btn_more = (LinearLayout) view.findViewById(C1069R.C1072id.btn_more);
        this.iv_swap = (ImageView) view.findViewById(C1069R.C1072id.iv_swap);
    }

    public void setView(InventionBean inventionBean2, int i) {
        this.inventionBean = inventionBean2;
        this.position = i;
        this.tv_title.setText(inventionBean2.getStationName());
        setRecycler();
        this.btn_more.setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.invention.view.OneView.View$OnClickListenerC11741 */

            public void onClick(View view) {
                OneView.this.onInventionType.onClick(OneView.this.inventionBean, OneView.this.position, view.getId());
            }
        });
        this.btn_swap.setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.invention.view.OneView.View$OnClickListenerC11752 */

            public void onClick(View view) {
                OneView.this.onInventionType.onClick(OneView.this.inventionBean, OneView.this.position, view.getId());
            }
        });
    }

    /* access modifiers changed from: package-private */
    public void setRecycler() {
        this.recycler.setLayoutManager(new GridLayoutManager(this.context, 2));
        AdapterInvention adapterInvention = new AdapterInvention(this.fragment, this.inventionBean.getVideoList());
        this.adapter = adapterInvention;
        adapterInvention.setDomain(this.domain);
        this.recycler.setAdapter(this.adapter);
        this.adapter.setItemListener(new ItemClickListener() {
            /* class com.androidx.p013lv.invention.view.OneView.C11763 */

            @Override // com.androidx.p013lv.base.listener.ItemClickListener
            public void onItemClick(View view, int i) {
                ((LazyFragment) OneView.this.fragment).startVideoPlay(((VideoBean) OneView.this.adapter.getDataInPosition(i)).getVideoId());
            }
        });
    }
}
